package controleur;

import java.io.IOException;

import modele.Paquet;
import vues.Bouton;
import client.morpion.ProjetAndroidM2Activity;
import android.view.View;
import android.view.View.OnClickListener;

public class ControleurBoutonJeu implements OnClickListener {
	private ProjetAndroidM2Activity activity;



	public ControleurBoutonJeu(ProjetAndroidM2Activity activity) {
		super();
		this.activity = activity;
	}



	public void onClick(View v) {
		// TODO Auto-generated method stub
		Bouton b = (Bouton)v;
		try
		{
			if(activity.getModele().isTour())
			{

				activity.getOut().writeObject(new Paquet(b.getCoord(),false,activity.getModele().getSymbole(),activity.getModele().getNumJoueur()));
			}
		}
		catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
